package com.p2p.controller.contentManagement;


import com.p2p.common.R;
import com.p2p.common.view.ArticleVo;
import com.p2p.entity.Article;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = "/article")
@Api(value = "新闻文章管理",tags = "新闻文章管理接口API")
public class ArticleController {

    @RequestMapping(value = "/findAllArticle",method = RequestMethod.GET)
    @ApiOperation(value = "新闻文章管理",notes = "显示新闻文章",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数默认第一页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示记录数",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findAllArticle(Integer currentPage,Integer pageSize){
        return null;
    }

    @RequestMapping(value = "/findArticleById",method = RequestMethod.POST)
    @ApiOperation(value = "返回新闻文章管理",notes = "返回新闻文章管理",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "新闻文章id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findArticleById(Integer id){
        return null;
    }

    @GetMapping(value = "/findArticleByCondition")
    @ApiOperation(value = "条件返回新闻",notes = "条件返回新闻",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R findArticleByCondition(@RequestBody @ApiParam(name = "articleVo",value = "查询条件",required = true)ArticleVo articleVo){
        return null;
    }

    @RequestMapping(value = "/addArticle",method = RequestMethod.POST)
    @ApiOperation(value = "添加新闻文章管理",notes = "添加新闻文章管理",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R addArticle(@RequestBody @ApiParam(name = "article",value = "新闻实体",required = true)Article article){
        return null;
    }

    @RequestMapping(value = "/deleteArticleById",method = RequestMethod.POST)
    @ApiOperation(value = "删除一条新闻文章管理",notes = "删除一条新闻文章管理",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "新闻文章id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R deleteArticleById(Integer id){
        return null;
    }

    @RequestMapping(value = "/updateArticle",method = RequestMethod.POST)
    @ApiOperation(value = "修改新闻文章管理",notes = "修改新闻文章管理",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R updateArticle(@RequestBody @ApiParam(name = "article",value = "新闻实体",required = true)Article article){
        return null;
    }
}
